/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef OHOS_LUAARKTS_NAPI_ARKTS_H
#define OHOS_LUAARKTS_NAPI_ARKTS_H

#include <string>
#include "napi/native_api.h"
using namespace std;

extern napi_env g_env;

//napi注册
napi_value TestNAPI(napi_env env, napi_callback_info info);
napi_value t2lCallFunction(napi_env env, napi_callback_info info);

//aki注册
string TestHelloWorld(std::string msg);
void InitLuaEnv(std::string sPath);
void SetLogShowState(bool bLogShowState);
napi_status LoadModule(std::string pathModuleTs, napi_value *pResult);
void t2lSetVarInt(std::string strVarInt, int32_t intValue);
void t2lSetVarLong(std::string strVarLong, int64_t longValue);
void t2lSetVarDouble(std::string strVarDouble, double doubleValue);
void t2lSetVarChar(std::string strVarChar, const char* charValue);
void t2lSetVarBool(std::string strVarBool, bool boolValue);
int t2lGetVarInt(std::string strVarInt);
int64_t t2lGetVarLong(std::string strVarLong);
double t2lGetVarDouble(std::string strVarDouble);
const char* t2lGetVarChar(std::string strVarChar);
int t2lGetVarBool(std::string strVarBool);
void t2lSetTableInt(std::string tab, std::string field, int value);
void t2lSetTableLong(std::string tab, std::string field, int64_t value);
void t2lSetTableDouble(std::string tab, std::string field, double value);
void t2lSetTableString(std::string tab, std::string field, std::string value);
void t2lSetTableBool(std::string tab, std::string field, bool value);
int t2lGetTableInt(std::string strTableName, std::string strVarInt);
int64_t t2lGetTableLong(std::string strTableName, std::string strVarLong);
double t2lGetTableDouble(std::string strTableName, std::string strVarDouble);
const char *t2lGetTableChar(std::string strTableName, std::string strVarChar);
int t2lGetTableBool(std::string strTableName, std::string strVarBool);

#endif //OHOS_LUAARKTS_NAPI_ARKTS_H
